import axios from 'axios'

export default {
  state: {
    tableData: []
  },
  getters: {},
  mutations: {
    SET_TABLE_DATA(state, payload) {
      state.tableData = payload
    }
  },
  actions: {
    async getList({ commit }, data) {
      const res = await axios({
        method: 'GET',
        url: 'http://localhost:3000/news'
      })
      commit('SET_TABLE_DATA', res.data)
    }
  },
  namespaced: true,
}


